﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="discussionForum.aspx.vb" Inherits="Web_2._0_BMW___X6_Experts_Web_Application.discussionForum" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .discussionInformation
        {
            height: 817px;
        }
        .ImagesUploadedByUsers
        {
            width: 341px;
            height: 527px;
        }
        .style2
        {
            text-decoration: underline;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <p style="font-size: x-large; font-weight: bolder; ">
        <span class="style2">BMW - X6 Discussion Forum</span>&nbsp;
       <a href  = "rssDiscussion.aspx">
        <asp:Image ID="Image2" runat="server" 
            ImageUrl="~/Pictures/feed-icon-28x28.png" BorderStyle="None" /></a>
    </p>

        <div class="discussionInformation">
        
        
            <span class="st">Welcome to the BMW - X6 Forums at www.bmw-x6.co.uk. Post all of 
            your BMW - X6 related questions and receive answers from our users &amp; industry 
            experts.<br />
            <br />
            Thousands of our users login everyday to posts discussions and give answers too, 
            its free help and guidance only for you!!! 
            <br />
            <br />
            You are currently not logged but to get involve, simply click <a href = "Account/Register.aspx">here</a> to register.
            <br />
            </span>

            

            <div class = "discussionsView">
            <div class  = "ImagesUploadedByUsers">
            
            
                <asp:ListView ID="ListView2" runat="server" DataSourceID="SqlDataSource2" 
                    style="text-align: center">
                    <AlternatingItemTemplate>
                        <span style="">
                        <asp:Image ID="Image1" runat="server" Height="200px" ImageUrl='<%# Eval("ImageLink") %>' Width="300px"  />

                        <br />
                        <strong>Image Description:</strong>
                        <asp:Label ID="ImageDescriptionLabel" runat="server" 
                            Text='<%# Eval("ImageDescription") %>' />
                        <br />
                        <strong>Date Uploaded:</strong>
                        <asp:Label ID="DateUploadedLabel" runat="server" 
                            Text='<%# Eval("DateUploaded") %>' />
                        <br />
                        <strong>Uploaded by:</strong>
                        <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' />
                        <br />
<br /></span>
                    </AlternatingItemTemplate>
                    <EditItemTemplate>
                        <span style="">
                        <asp:Image ID="Image1" runat="server" Height="200px" ImageUrl='<%# Eval("ImageLink") %>' Width="300px"  />
                        <br />
                        <strong>Image Description:</strong>
                        <asp:TextBox ID="ImageDescriptionTextBox" runat="server" 
                            Text='<%# Bind("ImageDescription") %>' />
                        <br />
                        <strong>Date Uploaded:</strong>
                        <asp:TextBox ID="DateUploadedTextBox" runat="server" 
                            Text='<%# Bind("DateUploaded") %>' />
                        <br />
                        <strong>Uploaded by:</strong>
                        <asp:TextBox ID="UserNameTextBox" runat="server" 
                            Text='<%# Bind("UserName") %>' />
                        <br />
                        <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                            Text="Update" />
                        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                            Text="Cancel" />
                        <br /><br /></span>
                    </EditItemTemplate>
                    <EmptyDataTemplate>
                        <span>No data was returned.</span>
                    </EmptyDataTemplate>
                    <InsertItemTemplate>
                        <span style="">
                        <asp:Image ID="Image1" runat="server" Height="200px" ImageUrl='<%# Eval("ImageLink") %>' Width="300px"  />
                        <br /><strong>Image Description:</strong>
                        <asp:TextBox ID="ImageDescriptionTextBox" runat="server" 
                            Text='<%# Bind("ImageDescription") %>' />
                        <br /><strong>Date Uploaded:</strong>
                        <asp:TextBox ID="DateUploadedTextBox" runat="server" 
                            Text='<%# Bind("DateUploaded") %>' />
                        <br /><strong>Uploaded by:</strong>
                        <asp:TextBox ID="UserNameTextBox" runat="server" 
                            Text='<%# Bind("UserName") %>' />
                        <br />
                        <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                            Text="Insert" />
                        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                            Text="Clear" />
                        <br /><br /></span>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <span style="">
                        <asp:Image ID="Image1" runat="server" Height="200px" ImageUrl='<%# Eval("ImageLink") %>' Width="300px"  />
                        <br />
                        <strong>Image Description:</strong>
                        <asp:Label ID="ImageDescriptionLabel" runat="server" 
                            Text='<%# Eval("ImageDescription") %>' />
                        <br />
                        <strong>Date Uploaded:</strong>
                        <asp:Label ID="DateUploadedLabel" runat="server" 
                            Text='<%# Eval("DateUploaded") %>' />
                        <br />
                        <strong>Uploaded by:</strong>
                        <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' />
                        <br />
<br /></span>
                    </ItemTemplate>
                    <LayoutTemplate>
                        <div ID="itemPlaceholderContainer" runat="server" style="">
                            <span runat="server" id="itemPlaceholder" />
                        </div>
                        <div style="">
                        </div>
                    </LayoutTemplate>
                    <SelectedItemTemplate>
                        <span style="">
                        <asp:Label ID="ImageLinkLabel" runat="server" Text='<%# Eval("ImageLink") %>' />
                        <br />
                        Image Description:
                        <asp:Label ID="ImageDescriptionLabel" runat="server" 
                            Text='<%# Eval("ImageDescription") %>' />
                        <br />
                        Date Uploaded:
                        <asp:Label ID="DateUploadedLabel" runat="server" 
                            Text='<%# Eval("DateUploaded") %>' />
                        <br />
                        Uploaded by
                        <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' />
                        <br />
<br /></span>
                    </SelectedItemTemplate>
                </asp:ListView>
                <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                    ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
                    
                    
                    SelectCommand="SELECT TOP 2 Images.ImageLink, Images.ImageDescription, Images.DateUploaded, aspnet_Users.UserName, Images.ImageID FROM (Images INNER JOIN aspnet_Users ON Images.UserIDFK = aspnet_Users.UserId) ORDER BY Images.ImageID DESC">
                </asp:SqlDataSource>
            
            
            </div>
                <asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1" 
                    style="font-size: small; font-family: Calibri;">
                    <AlternatingItemTemplate>
                       
                        
                        <strong>Title:</strong>
                        <a href="posts.aspx?id=<%# Eval("DiscussionID") %>"><asp:Label ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' /> </a>
                        <br />
                        <strong>Date Discussion Created:</strong>
                        <asp:Label ID="DateCreatedLabel" runat="server" 
                            Text='<%# Eval("DateCreated") %>' />
                        <br />
                        <strong>Created by:</strong>
                        <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' />
                        <br />

                    </AlternatingItemTemplate>
                    <EditItemTemplate>
                        DiscussionID:
                        <asp:Label ID="DiscussionIDLabel1" runat="server" 
                            Text='<%# Eval("DiscussionID") %>' />
                        <br />
                        <strong>Title:</strong>
                        <a href="posts.aspx?id=<%# Eval("DiscussionID") %>"><asp:Label ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' /> </a>
                        <br />
                        <strong>Date Discussion Created:</strong>
                        <asp:TextBox ID="DateCreatedTextBox" runat="server" 
                            Text='<%# Bind("DateCreated") %>' />
                        <br />
                        <strong>Created by:</strong>
                        <asp:TextBox ID="UserNameTextBox" runat="server" 
                            Text='<%# Bind("UserName") %>' />
                        <br />
                        <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                            Text="Update" />
                        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                            Text="Cancel" />
                        <br />
                        <br />
                        </span>
                    </EditItemTemplate>
                    <EmptyDataTemplate>
                        <span>No data was returned.</span>
                    </EmptyDataTemplate>
                    <InsertItemTemplate>
                        DiscussionID:
                        <asp:Label ID="DiscussionIDLabel1" runat="server" 
                            Text='<%# Eval("DiscussionID") %>' />
                        <br />
                        <strong>Title:</strong>
                        <a href="posts.aspx?id=<%# Eval("DiscussionID") %>"><asp:Label ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' /> </a>
                        <br />
                        <strong>Date Discussion Created:</strong>
                        <asp:TextBox ID="DateCreatedTextBox" runat="server" 
                            Text='<%# Bind("DateCreated") %>' />
                        <br />
                        <strong>Created by:</strong>
                        <asp:TextBox ID="UserNameTextBox" runat="server" 
                            Text='<%# Bind("UserName") %>' />
                        <br />
                        <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                            Text="Update" />
                        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                            Text="Cancel" />
                        <br />
                        <br />
                        </span>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        

                        <br />
                        <strong>Title:</strong>
                        <a href="posts.aspx?id=<%# Eval("DiscussionID") %>"><asp:Label ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' /> </a>
                        <br />
                        <strong>Date Discussion Created:</strong>
                        <asp:Label ID="DateCreatedLabel" runat="server" 
                            Text='<%# Eval("DateCreated") %>' />
                        <br />

                        <strong>Created by:</strong>
                        <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' />

                        <br />
                        <br />
                        </span>
                    </ItemTemplate>
                    <LayoutTemplate>
                        <div ID="itemPlaceholderContainer" runat="server" 
                            style="font-family: Verdana, Arial, Helvetica, sans-serif;">
                            <span runat="server" id="itemPlaceholder" />
                        </div>
                        <br />
                        <br />
                        <div>
                                                      
                                                    <asp:DataPager ID="DataPager1" runat="server" PagedControlID="ListView1" PageSize="10">
                            
                                <Fields>
                                    <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                                        ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                    <asp:NumericPagerField />
                                    <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" 
                                        ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                </Fields>
                            </asp:DataPager>
                        </div>
                    </LayoutTemplate>
                    <SelectedItemTemplate>
                        DiscussionID:
                        <asp:Label ID="DiscussionIDLabel1" runat="server" 
                            Text='<%# Eval("DiscussionID") %>' />
                        <br />
                        <strong>Title:</strong>
                       <a href="posts.aspx?id=<%# Eval("DiscussionID") %>"><asp:Label ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' /> </a>
                        <br />
                        <strong>Date Discussion Created:</strong>
                        <asp:TextBox ID="DateCreatedTextBox" runat="server" 
                            Text='<%# Bind("DateCreated") %>' />
                        <br />
                        <strong>Created by:</strong>
                        <asp:TextBox ID="UserNameTextBox" runat="server" 
                            Text='<%# Bind("UserName") %>' />
                        <br />

                        <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                            Text="Update" />
                        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                            Text="Cancel" />
                        <br />
                     
                        </span>
                    </SelectedItemTemplate>
                </asp:ListView>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                    ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
                   SelectCommand="SELECT Discussion.DiscussionID, Discussion.Title, Discussion.DateCreated, aspnet_Users.UserName FROM (Discussion INNER JOIN aspnet_Users ON Discussion.UserIDFK = aspnet_Users.UserId) GROUP BY Discussion.Title, Discussion.DateCreated, Discussion.DiscussionID, aspnet_Users.UserName ORDER BY Discussion.DiscussionID DESC">
                </asp:SqlDataSource>
            </div>
        
        
        </div>
</asp:Content>
